async function fun() {
    let operas;
    // let movies;
    let info = location.search.substr(4);
    await $.ajax({
        url: 'https://www.fastmock.site/mock/bb4157f45a0b5ffdcb3f6d984517a6c0/woniuMovie/getAllOperas',
        success: (data) => {
            operas = data.operas;
            let opera = operas.find(opera => opera.id == info);
            console.log(opera);
            $("header").css({
                "background": `url(${opera.img_src}) no-repeat`,
                "backgroundSize": "100%"
            });
            $(".des").append($(
                `<p>${opera.name}</p>
            <span>${opera.address}</span>
            <section>
                <div>
                    <span><i class="iconfont icon-dingwei"></i>1.0km</span>
                    <b>15 分钟</b>
                </div>
                <div>
                    <ul>
                        <li>￥</li>
                        <li>￥</li>
                        <li>￥</li>
                        <li>￥</li>
                    </ul>
                    <b>￥30 起</b>
                </div>
                <div>
                    <span><i></i>4.8</span>
                    <b>1000+ 评分</b>
                </div>
            </section>`
            ));

        }
    });
    await $.ajax({
        url: 'https://www.fastmock.site/mock/bb4157f45a0b5ffdcb3f6d984517a6c0/woniuMovie/getAllMovies',
        success: (data) => {
            const movies = data.movies;
            let opera = operas.find(opera => opera.id == info);
            let movie = movies.filter(movie => {
                return opera.movies.find(item => item == movie.id);
            });
            let newMovie = movie.map(item =>
                `<li>
                    <img src="${item.imgSrc}" alt="">
                    <div>
                        <p>${item.title}</p>
                        <b>￥${item.price}起</b>
                        <em>放映时间</em>
                        <div>
                            <a href="javascript:;">13:00</a>
                            <a href="javascript:;">15:00</a>
                            <a href="javascript:;">17:00</a>
                            <a href="javascript:;">19:00</a>
                            <a href="javascript:;">21:00</a>
                        </div>
                    </div>
                </li>`
            );
            $("#filmlist").html(newMovie);


        }
    });

    $("#filmlist").on('click', function () {
        location.assign(`../html/xiangqing.html${location.search}`);
    });

    // 回退
    $("header").on('click', 'a', function () {
        history.go(-1);
    });
}
fun();